// Copyright: personal possession of Nguyen Minh Kha
// Datetime: 09:27PM 10/14/2011
// Discription: This is player in the game.
// Licencse: Free source
// Version: 1.0
// Writer: Nguyen Minh Kha

/* Google opensource coding standard with variable name exception */

#ifndef GAMEFRAMEWORK_GAMEOBJECT_PLAYER_H_
#define GAMEFRAMEWORK_GAMEOBJECT_PLAYER_H_

#include "objects_manager.h"
#include "renderable_manager.h"
#include "collisionable_manager.h"
#include "controllable_manager.h"
#include "convert_interface.h"
#include "moveable_interface.h"
#include "static_sprite.h"
#include "animated_sprite.h"


class Player : public GameObject, 
    public RenderableObject,
    public CollisionableObject,
    public ControllableObject,
    public ConvertInterface,
    public MoveableInterface
{
private:
  enum Personal {
    SMALL,
    BIG,
    FLOWER

  };

  enum State {
    JUMP,
    STAND,
    SWIM,
    RUN,
    SIT
  };


public:
  Player(void);
  ~Player(void);
public:
  /* Inherit method */

  void Init();
  void Release();
  void Render();
  void DoControl(bool key_down, int key_code);
  void DoControlThread();
  void DoCollision(CollisionableObject* collisionedObject);
  void DoCollisionThread();
  CString* ToArray();
  void FromArray(CString*);
  void MoveLeft();
  void MoveRight();
  void MoveUp();
  void MoveDown();
private:
  void Fire();
  void Jump();
private:
  int score;
  unsigned char life;
  unsigned char money;
  bool vulnerable;
  Personal personal;
  State state;

  // State object

  // Render object

  AnimatedSprite spriteMoveLeftSmall;
  AnimatedSprite spriteMoveLeftBig;
  AnimatedSprite spriteMoveLeftFlower;
  AnimatedSprite spriteMoveRightSmall;
  AnimatedSprite spriteMoveRightBig;
  AnimatedSprite spriteMoveRightFlower;
  
  StaticSprite spriteStand;
  StaticSprite spriteJump;
  

  AnimatedSprite *spriteMoveLeft;
  AnimatedSprite *spriteMoveRight;
  

  // Sound object


};

#endif // GAMEFRAMEWORK_GAMEOBJECT_PLAYER_H_

